Set up Microsoft Power Automate with Sage 200
Microsoft Power Automate (formerly called Microsoft Flow) is a cloud-based service that makes it practical and simple for people to build workflows that automate business tasks and processes across applications and services.
You can set up Power Automate with Sage 200 to use our supplied flows, and create your own flows.
We provide some example flows, such as:
-
Purchase requisition flow for email notifications.
-
Supplier bank details flow for email notifications.
Note: We also provide some additional example flows. See Power Automate Demonstration Application (opens in a new tab).
What do I need to use Power Automate?
To use Microsoft Power Automate, you'll need:
-
A Microsoft 365 subscription: Microsoft 365 Business Standard (formerly Office 365 Business Premium), Enterprise (E1, E3 or E5).
-
Your Microsoft 365 subscription must include Microsoft Entra ID P1 or P2 (formerly Azure Active Directory Premium P1 or P2).
-
A Power Automate Per user plan.
To choose the Microsoft Power Automate plan that's right for you, see Power Automate pricing (opens in a new tab).
How to connect Sage 200 and Power Automate
Follow the steps below to set up Sage 200 with Power Automate:
-
Create a Microsoft Entra enterprise application (formerly Azure Active Directory application).
-
Create the Sage 200 Custom Connector.
-
Set up the provided flows for email notifications.
Create a Microsoft Entra enterprise application
Note: Microsoft Entra ID was formerly known as Azure Active Directory (AAD).
First you need to create a Microsoft Entra enterprise application.
-
Go to entra.microsoft.com (opens in a new tab) and sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
-
Select Identity > Applications > App registrations.
-
Select New registration.
-
Set the Name for the application, for example Sage 200 application.
-
Leave the supported account types set to Accounts in the organizational directory only.
-
Leave the Redirect URI blank, as you'll enter that later when you create a Custom Connector.
-
Select Register.
Once the application has registered, you'll see an overview with details of the application.
-
- Copy the Application (client) ID to the clipboard and keep this somewhere. You'll need this later when you create the Custom Connector.
-
Select Certificates & secrets.
- Select New client secret.
- Enter a Description, such as Sage 200 client key.
- Set Expires to the expiry date, for example 24 months.
-
Select Add.
A new client secret will be displayed.
-
Copy the Value of the new client secret to the clipboard, and save this somewhere. You'll need this later.
Note - warningYou must keep a note of the client secret Value now, as you will not be able to return to this page once you leave.
-
Select API permissions.
-
Select Add a permission.
-
Select APIs my organization uses.
-
Select Sage 200c API from the list.
Tip: To find this, type sage in the Search box to filter the list.
-
In Delegated permissions, select (tick) all the permissions that are listed.
Note:-
You may only see one permission listed, for user_impersonation.
-
The permissions in each group may not be visible, so to display them you must open each group, or select Expand all.
-
- Select Add permissions.
-
Download the custom connector and flows
You will need to download the files required to set up your custom connector and flows.
-
Download the Custom connector and flows (opens in a new tab).
-
Open and unzip the *.zip file.
This contains:
-
Custom Connectors\Sage 200.PowerApps.swagger.json
OpenAPI (Swagger) file that you'll use to create the custom connector.
-
Purchase Requisition Email Flow\PurchaseRequisitionAuthorisationFlow.zip
Used to set up the purchase requisitions flow (email notifications).
-
Supplier Bank Email Flow\SupplierBankDetailsFlow.zip
Used to set up the supplier bank details flow (email notifications).
-
Create the Sage 200 Custom Connector
You will need to create a Custom Connector for Microsoft Power Automate to access your data in Sage 200.
To create a Custom Connector, you must have first created your Microsoft Entra enterprise application (formerly Azure Active Directory application.).
Note: If you have already created a Custom Connector for Sage 200 before the 2020 R1 release, you will need to update your Custom Connector first before you create new flows. See Update an existing Custom Connector.
Get your subscription key
To set up the Sage 200 Custom Connector you will need your subscription key (also known as your primary key for the Sage API).
-
Select Sign In, and sign in using your Sage account.
-
If you already have a subscription for Sage 200 Unlimited, select Profile.
If you don't have a subscription yet, create a subscription now:
-
Select Products.
-
Select Sage 200 Unlimited.
-
Enter a name for your subscription and select Subscribe.
-
-
In the Subscriptions section, select to Show your Primary key .
-
Make a note of the Primary key somewhere, for example copy and paste it into notepad. You'll need to enter this as your subscription key later.
Create your Custom Connector
-
Go to make.powerautomate.com (opens in a new tab) and sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
Note: The instructions here will show you how to create a Custom Connector in Microsoft Power Automate, but you can also create it in Power Apps.
-
Select Data > Custom connectors.
-
Select New Custom Connector > Import an OpenAPI file.
-
Enter the Connector name, for example Sage 200 Connector.
-
Select Import.
-
Select the file Sage 200.PowerApps.swagger.json that you downloaded, then select Open.
-
Select Continue to create the connector.
-
-
Once the connector has been created, enter the connector's settings.
-
On the General tab:
-
Do not select Connect via on-premises data gateway (this is not selected by default).
-
Set the Scheme to HTTPS.
-
Edit the Host to read api.columbus.sage.com (by default this is s200api.columbus.sage.com).
-
Set the Base URL to /uk/sage200/accounts/v1
-
-
Move to the Security tab:
-
Set the Authentication type to OAuth 2.0.
-
Set the Identity provider to Azure Active Directory.
-
Set the Client ID to the Application (client) ID for your application.
You will have copied this earlier when you created the Azure Active Directory application.
-
Set the Client secret to the client secret value for your application.
You will have copied this earlier when you created the Azure Active Directory application.
-
Set the Resource URL to https://SageCSPEU.onmicrosoft.com/6ce3bbc5-d381-4d11-b079-50accd62241a
-
Do not change the Login URL, Tenant ID, and Scope.
-
-
Select Create connector.
It might take a minute for the connector to be created.
-
Once the connector has been created, copy the Redirect URL to the clipboard.
You'll need to enter this in your Microsoft Entra enterprise application.
-
-
Go to entra.microsoft.com (opens in a new tab) and sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
-
Select Identity > Applications > App registrations.
-
Select the application that you created.
-
Select Authentication.
-
Select Add a platform (in platform configurations).
-
Select the Web application type.
-
Set the Redirect URI to the Redirect URL that you copied from your Custom Connector.
-
Select Configure to add the platform configuration.
-
-
-
Go back to your Custom Connector at make.powerautomate.com (opens in a new tab).
-
Move to the Test tab.
-
Select New Connection (in the Connections section).
-
Select Create to create the connection.
-
You may asked to sign in with your Microsoft 365 account, and Accept the permissions requested.
Sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
-
The new connection to the Custom Connector will be displayed in the Connections list.
-
-
Select Custom Connectors.
-
Select Edit (pencil icon) for your Custom Connector.
-
Move to the Test tab.
-
Select GetSites from the list of Operations.
-
Set ocp-apim-subscription-key to your subscription key for the Sage API.
-
Select Test operation.
It might take a minute for the test to complete.
-
Check the test Response:
-
The Status will show OK (200) if the test was successful.
-
The Body will show details of your companies in Sage 200.
Copy the
company_id
andsite_id
for each of your companies. You'll need these details later when you set up a flow.Example of response with company details[ { "company_id": 1, "company_name": "Company One", "site_id": "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx", "site_name": "YourSiteName" }, { "company_id": 2, "company_name": "Company Two", "site_id": "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx", "site_name": "YourSiteName" } ]
Note:If the status is OK (200) but you don't see any company details in the Body, this might be because:
-
Your Sage 200 server is not running.
-
You haven't yet set up Sage 200 to connect with Microsoft 365, and assigned your Microsoft account email address with a user account in Sage 200.
-
-
-
Select Close.
-
Share your Custom Connector
If other people in your organisation will also be setting up Power Automate or Power Apps, you can share your Custom Connector with them.
You can skip this step if you don't want to share the Custom Connector, or want to do this later.
- Go to powerapps.microsoft.com (opens in a new tab) and sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
- Select Data > Custom connectors.
- Select ... for your Custom Connector, and select Invite another user from the menu.
-
Enter the Microsoft 365 email addresses for each person you want to share the Custom Connector with.
- Select Save.
Update an existing Custom Connector
If you have already created a Custom Connector for Sage 200 before the 2020 R1 release, you will need to update your Custom Connector first before you create new flows. See Update an existing Custom Connector.
Your existing flows will continue to work with the updated Custom Connector, so you don't need to update your flows too.
Note: Before you start, you will need to download the latest version of the custom connector. See download the custom connector and flows.
- Go to powerapps.microsoft.com (opens in a new tab) and sign in the Microsoft 365 account you used to activate your subscription and link to Sage 200.
- Select Data > Custom connectors.
- Select ... for your Custom Connector, and select Update from OpenAPI file from the menu.
- Select Import.
- Select the file Sage 200.PowerApps.swagger.json that you downloaded, then select Open.
- Select Continue to update the connector.
-
Once the connector has been updated, enter the connector's settings.
-
On the General tab:
- Do not select Connect via on-premises data gateway (this is not selected by default).
- Set the Scheme to HTTPS.
-
Set the Host to api.columbus.sage.com.
- Set the Base URL to /uk/sage200/accounts/v1.
-
Move to the Security tab:
- Set the Authentication type to OAuth 2.0.
- Set the Identity provider to Azure Active Directory.
-
Set the Client ID to the Application (client) ID for your Azure Active Directory application.
- Set the Client secret to the client secret value for your Azure Active Directory application.
-
Set the Resource URL to https://SageCSPEU.onmicrosoft.com/6ce3bbc5-d381-4d11-b079-50accd62241a.
-
Do not change the Login URL, Tenant ID, and Scope.
-
Select Update connector.
It might take a minute for the connector to be created.
-
Move to the Test tab.
- Select New Connection (in the Connections section).
-
Select Create to create the connection.
-
You may asked to sign in with your Microsoft 365 account, and Accept the permissions requested.
Sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
- The new connection to the Custom Connector will be displayed in the Connections list.
-
- Select Custom Connectors.
- Select Edit (pencil icon) for your Custom Connector.
- Move to the Test tab.
- Select GetSites from the list of Operations.
- Set ocp-apim-subscription-key to your subscription key for the Sage API.
-
Select Test operation.
It might take a minute for the test to complete.
-
Check the test Response:
-
The Status will show OK (200) if the test was successful.
-
The Body will show details of your companies in Sage 200.
Copy the
company_id
andsite_id
for each of your companies. You'll need these details later when you set up a flow.Example of response with company details[ { "company_id": 1, "company_name": "Company One", "site_id": "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx", "site_name": "YourSiteName" }, { "company_id": 2, "company_name": "Company Two", "site_id": "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx", "site_name": "YourSiteName" } ]
Note:If the status is OK (200) but you don't see any company details in the Body, this might be because:
- Your Sage 200 server is not running.
- You haven't yet set up Sage 200 to connect with Microsoft 365, and assigned your Microsoft account email address with a user account in Sage 200.
-
- Select Close.
-
Set up the provided flows
We provide some example flows for email notifications:
- Purchase requisition flow for email notifications.
- Supplier bank details flow for email notifications.
Note: To set up these flows you will need your subscription key for the Sage API, and the site_id
and company_id
for each company. You can find your site_id
and company_id
when you run the GetSites test with your Custom Connector.
Note: We also provide some additional example flows. See Power Automate Demonstration Application (opens in a new tab).
Purchase requisitions flow (email notifications)
The purchase requisitions flow automatically sends emails to people to notify them during the authorisation process.
- Authorisers will receive email notifications when they have new purchase requisitions that require authorisation.
- The person who submitted the purchase requisition will receive an email notification when it is authorised or rejected.
This flow will run once per day and will send email notifications emails at 4pm (16:00), but you can configure the flow to change this frequency and timing.
Note: If you use multiple companies, the flow must be set up for each company.
Set up the flow
- Go to make.powerautomate.com (opens in a new tab) and sign in the Microsoft 365 account you used to activate your subscription and link to Sage 200.
- If you have more than one environment, check you're using the correct environment.
- Select My flows.
- Select Import.
-
Select Upload, then select the PurchaseRequisitionAuthorisationFlow.zip file that you downloaded.
-
Set the import options in Review Package Content.
-
Purchase Requisition Authorisation Flow - Flow:
- Select the Action icon.
- Set Setup to Create as new.
- Select Save.
-
Sage 200 Custom Connector - Connector:
- Select the Action icon.
- Select the name of your Custom Connector from the list (so it is ticked).
- Select Save.
-
(email) - Sage 200 Custom Connector Connection:
- Select the Action icon.
- Select the email address of your Microsoft account from the list (so it is ticked).
- Select Save.
-
(email) - Office 365 Outlook Connection:
- Select the Action icon.
- Select Create new. This will open a new page with a list of connections.
- Select New connection.
-
Select Office 365 Outlook from the list, then select Create.
Tip: To find this, type off in the Search box to filter the list.
- Go back to your flow, and select Refresh list to display the new connection.
- Select the connection from the list (so it is ticked).
- Select Save.
-
Notifications - Notifications Connection: Select the Action icon, then select the email address for your Microsoft account from the list (so it is ticked). Select Save.
- Select the Action icon.
- Select Create new. This will open a new page with a list of connections.
- Select New connection.
-
Select Notifications from the list, then select Create.
Tip: To find this, type not in the Search box to filter the list.
- Go back to your flow, and select Refresh list to display the new connection.
- Select the connection from the list (so it is ticked).
- Select Save.
-
-
Once you've set up each import option, select Import to create the new flow.
Note: You can only do this once each import option is complete.
-
Select My flows. The Purchase Requisition Authorisation Flow is displayed.
Tip: If you can't see your flow, try refreshing your browser.
- Select Edit (pencil icon) for the new Purchase Requisition Authorisation Flow.
- If you want to change the frequency of the flow to send email notifications, select Trigger. By default, the flow runs once per day at 4pm (16:00).
Select Initialize SubscriptionKey, then set the Value to your subscription key for the Sage API.
Select Initialize SiteID, then set the Value to the
site_id
for the Sage 200 company.Select Initialize CompanyID, then set the Value to the
company_id
for the Sage 200 company.Once you’ve entered the properties, select Save.
-
Check that your flow works:
- Go to My flows, and select Run for the flow.
- Select Run flow to start the flow.
-
Once the flow is running, you can check the Run history for flow.
If the flow is working, its Status will show Succeeded when it is complete.
Tip: Try refreshing your browser to update the status.
Set up email addresses for users
Once you've set up the flow, enable notifications for each user:
Open: Settings > Organisational and Financial > User Access.
- Select the user from the Users list.
- Select the API tab.
- Enable Allow notifications.
- Enter the user's email address to be used for email notifications.
Supplier bank details flow (email notifications)
You can send email notifications for changes to supplier bank details by using the supplier bank details flow.
The supplier bank details flow automatically sends emails to people to notify them of any changes to the bank details for supplier accounts. The emails are sent to everyone that has user access to the Audit Log, so that they can check the changes in the log.
This flow will run at 15 minute intervals each day, but you can configure the flow to change this frequency and timing.
Note: If you use multiple companies, the flow must be set up for each company.
Set up the flow
- Go to make.powerautomate.com (opens in a new tab) and sign in using the Microsoft 365 account you used to activate your subscription and link to Sage 200.
- If you have more than one environment, check you're using the correct environment.
- Select My flows.
- Select Import.
-
Select Upload, then select the SupplierBankDetailsFlow.zip file that you downloaded.
-
Set the import options in Review Package Content.
-
SupplierBankDetailsFlow - Flow:
- Select the Action icon.
- Set Setup to Create as new.
- Select Save.
-
Sage 200 Custom Connector - Connector:
- Select the Action icon.
- Select the name of your Custom Connector from the list (so it is ticked).
- Select Save.
-
(email) - Sage 200 Custom Connector Connection:
- Select the Action icon.
- Select the email address of your Microsoft account from the list (so it is ticked).
- Select Save.
-
(email) - Office 365 Outlook Connection:
- Select the Action icon.
- Select your Office 365 Outlook connection (if you've previously created a flow), or select Create new to add the connection.
- Select Save.
-
Notifications - Notifications Connection: Select the Action icon, then select the email address for your Microsoft account from the list (so it is ticked). Select Save.
- Select the Action icon.
- Select your Notifications connection (if you've previously created a flow), or select Create new to add the connection.
- Select Save.
-
-
Once you've set up each import option, select Import to create the new flow.
Note: You can only do this once each import option is complete.
-
Select My flows. The Supplier Bank Details Flow is displayed.
Tip: If you can't see your flow, try refreshing your browser.
-
Select Edit (pencil icon) for the new Supplier Bank Details Flow.
- If you want to change the frequency of the flow to send email notifications, select Recurrence. By default, the flow runs every 15 minutes.
-
Select Initialize SubscriptionKey, then set the Value to your subscription key for the Sage API.
-
Select Initialize SiteID, then set the Value to the
site_id
for the Sage 200 company. -
Select Initialize CompanyID, then set the Value to the
company_id
for the Sage 200 company. -
Once you’ve entered the properties, select Save.
-
Check that your flow works:
- Go to My flows, and select Run for the flow.
- Select Run flow to start the flow.
-
Once the flow is running, you can check the Run history for flow.
If the flow is working, its Status will show Succeeded when it is complete.
Tip: Try refreshing your browser to update the status.
You'll also need to set up email addresses for all users that will receive notifications. See Set up email addresses for users.
Set up Microsoft 365 for connected apps, Power BI, or Power Automate
Microsoft Power Automate and Power Apps
Create or amend supplier accounts
Assign feature access to users
Other useful information
Sage 200 - Onboarding for Microsoft Power Automate and Power Apps (opens in a new tab)
Microsoft Power Automate and Sage 200 (opens in a new tab)
Microsoft Power Apps and Microsoft Power Automate (Microsoft) (opens in a new tab)